package com.easondongh.system.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 时间相关的工具类
 * @author EasonDongH
 * @date 2020/3/27 21:50
 */
public class DateTimeUtils {

    private static final String DEF_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss";

    private static SimpleDateFormat DEF_DATE_FORMAT;

    static {
        DEF_DATE_FORMAT = new SimpleDateFormat(DEF_DATE_PATTERN);
    }

    public static String DateToString(Date date){
        return DEF_DATE_FORMAT.format(date);
    }

}